//
// CDRU.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.CVector;

public class CDRU {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CDRU(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CDRU obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CDRU(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static IDriver createGlDriver() {
    long cPtr = nel3dJNI.CDRU_createGlDriver();
    return (cPtr == 0) ? null : new IDriver(cPtr, false);
  }

  public static void drawBitmap(float x, float y, float width, float height, ITexture texture, IDriver driver, CViewport viewport, boolean blend) {
    nel3dJNI.CDRU_drawBitmap__SWIG_0(x, y, width, height, ITexture.getCPtr(texture), texture, IDriver.getCPtr(driver), driver, CViewport.getCPtr(viewport), viewport, blend);
  }

  public static void drawBitmap(float x, float y, float width, float height, ITexture texture, IDriver driver, CViewport viewport) {
    nel3dJNI.CDRU_drawBitmap__SWIG_1(x, y, width, height, ITexture.getCPtr(texture), texture, IDriver.getCPtr(driver), driver, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawBitmap(float x, float y, float width, float height, ITexture texture, IDriver driver) {
    nel3dJNI.CDRU_drawBitmap__SWIG_2(x, y, width, height, ITexture.getCPtr(texture), texture, IDriver.getCPtr(driver), driver);
  }

  public static void drawLine(float x0, float y0, float x1, float y1, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawLine__SWIG_0(x0, y0, x1, y1, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawLine(float x0, float y0, float x1, float y1, IDriver driver, CRGBA col) {
    nel3dJNI.CDRU_drawLine__SWIG_1(x0, y0, x1, y1, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col);
  }

  public static void drawLine(float x0, float y0, float x1, float y1, IDriver driver) {
    nel3dJNI.CDRU_drawLine__SWIG_2(x0, y0, x1, y1, IDriver.getCPtr(driver), driver);
  }

  public static void drawTriangle(float x0, float y0, float x1, float y1, float x2, float y2, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawTriangle(x0, y0, x1, y1, x2, y2, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawQuad(float x0, float y0, float x1, float y1, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawQuad__SWIG_0(x0, y0, x1, y1, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawQuad(float x0, float y0, float x1, float y1, CRGBA col0, CRGBA col1, CRGBA col2, CRGBA col3, IDriver driver, CViewport viewport) {
    nel3dJNI.CDRU_drawQuad__SWIG_1(x0, y0, x1, y1, CRGBA.getCPtr(col0), col0, CRGBA.getCPtr(col1), col1, CRGBA.getCPtr(col2), col2, CRGBA.getCPtr(col3), col3, IDriver.getCPtr(driver), driver, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawQuad(float xcenter, float ycenter, float radius, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawQuad__SWIG_2(xcenter, ycenter, radius, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawWiredQuad(float x0, float y0, float x1, float y1, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawWiredQuad__SWIG_0(x0, y0, x1, y1, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawWiredQuad(float xcenter, float ycenter, float radius, IDriver driver, CRGBA col, CViewport viewport) {
    nel3dJNI.CDRU_drawWiredQuad__SWIG_1(xcenter, ycenter, radius, IDriver.getCPtr(driver), driver, CRGBA.getCPtr(col), col, CViewport.getCPtr(viewport), viewport);
  }

  public static void drawTrianglesUnlit(SWIGTYPE_p_NLMISC__CTriangleUV trilist, int ntris, CMaterial mat, IDriver driver) {
    nel3dJNI.CDRU_drawTrianglesUnlit__SWIG_0(SWIGTYPE_p_NLMISC__CTriangleUV.getCPtr(trilist), ntris, CMaterial.getCPtr(mat), mat, IDriver.getCPtr(driver), driver);
  }

  public static void drawTrianglesUnlit(SWIGTYPE_p_std__vectorT_NLMISC__CTriangleUV_t trilist, CMaterial mat, IDriver driver) {
    nel3dJNI.CDRU_drawTrianglesUnlit__SWIG_1(SWIGTYPE_p_std__vectorT_NLMISC__CTriangleUV_t.getCPtr(trilist), CMaterial.getCPtr(mat), mat, IDriver.getCPtr(driver), driver);
  }

  public static void drawLinesUnlit(SWIGTYPE_p_NLMISC__CLine linelist, int nlines, CMaterial mat, IDriver driver) {
    nel3dJNI.CDRU_drawLinesUnlit__SWIG_0(SWIGTYPE_p_NLMISC__CLine.getCPtr(linelist), nlines, CMaterial.getCPtr(mat), mat, IDriver.getCPtr(driver), driver);
  }

  public static void drawLinesUnlit(SWIGTYPE_p_std__vectorT_NLMISC__CLine_t linelist, CMaterial mat, IDriver driver) {
    nel3dJNI.CDRU_drawLinesUnlit__SWIG_1(SWIGTYPE_p_std__vectorT_NLMISC__CLine_t.getCPtr(linelist), CMaterial.getCPtr(mat), mat, IDriver.getCPtr(driver), driver);
  }

  public static void drawLine(CVector a, CVector b, CRGBA color, IDriver driver) {
    nel3dJNI.CDRU_drawLine__SWIG_3(CVector.getCPtr(a), a, CVector.getCPtr(b), b, CRGBA.getCPtr(color), color, IDriver.getCPtr(driver), driver);
  }

  public static void drawWiredBox(CVector corner, CVector vi, CVector vj, CVector vk, CRGBA color, IDriver driver) {
    nel3dJNI.CDRU_drawWiredBox(CVector.getCPtr(corner), corner, CVector.getCPtr(vi), vi, CVector.getCPtr(vj), vj, CVector.getCPtr(vk), vk, CRGBA.getCPtr(color), color, IDriver.getCPtr(driver), driver);
  }

  public CDRU() {
    this(nel3dJNI.new_CDRU(), true);
  }

}
